import cache_set from '@dfeidao/atom-wxapp/api/cache/set';
import { post } from '@dfeidao/atom-wxapp/api/network/request';
import { IFeidaoAiWeappPage } from '@dfeidao/atom-wxapp/interfaces';
import nodejs from '@dfeidao/atom-wxapp/msg/nodejs';
import { login, productid } from '../atom/config';

export default async function a001(fd: IFeidaoAiWeappPage, ...args: any[]) {
	const res = await post(login, {
		usercode: 'admin',
		userpw: '111111'
	});
	const userinfo = res.data;

	cache_set('userinfo', userinfo);
	const data = await nodejs('test/s001', {
		productid
	});
	if (!data) {
		alert('Fail');
	} else {
		alert('Success');
	}
}
